/**
 * 转化style对象为字符串
 * @param {Object} styleObj
 */
export function transStyleObject(styleObj) {
  // 类型容错
  if (Object.prototype.toString.call(styleObj) !== `[object Object]`) {
    return ''
  }

  let transfrom = ''
  for (let i in styleObj) {
    let line = i.replace(/([A-Z])/g, "-$1").toLowerCase();
    transfrom += line + ':' + styleObj[i] + ';'
  }
  return transfrom
}